<!-- 批发采购订单-申请退货 -->
<template>
  <div class="purchase-return-order">
    <div class="title">
      <h1>申请退货</h1>
    </div>
    <div class="block">
      <section class="returnOrder">
        <el-steps
          :active="active_index - 1"
          process-status="success"
          finish-status="success"
          align-center
        >
          <el-step
            v-for="(item, i) in STEP_ITEMS"
            :key="i"
            :title="item.title"
          />
        </el-steps>
        <p v-if="String(queryParams.orderType) === '2'" class="original-code">
          原采购单号：<span>{{ idKey.orderCodeRelate }}</span>
        </p>
      </section>
    </div>
    <!-- <article v-show="active_index === 1" class="article-box">
      <supplier-and-contract-component
        :supplier-id.sync="submit_data.supplier_id"
        :contract-id.sync="submit_data.contract_id"
        :is-first-mount.sync="status.isFirstMount"
        :products="submit_data.return_goods"
        @change="onSupplierAndContractChange"
        @getOrderTypeRows="getOrderTypeRows"
      />
    </article> -->
    <article
      v-show="active_index === 1"
      class="article-box select-product-corver"
    >
      <products-list
        :is-original="true"
        title="添加退货产品"
        search-label="发货单号"
        :products.sync="submit_data.return_goods"
        :step-one-form-data="submit_data"
      >
        1、退货产品
        <template #btn>
          <el-button type="primary" class="right" @click="addWholeOrderProducts"
            >整单退货</el-button
          >
        </template>
      </products-list>
      <reason
        :reason-sel.sync="submit_data.return_reason.reason_sel"
        :reason-text.sync="submit_data.return_reason.reason_text"
        :reason-imgs.sync="submit_data.return_reason.reason_imgs"
        @reasonName="getReasonName"
      >
        <h2 class="required">
          2、退货原因
        </h2>
      </reason>
    </article>
    <article v-show="active_index === 2" class="article-box order-info">
      <header>
        <h2 class="required">
          1、订单类型
        </h2>
      </header>
      <section>
        <el-form>
          <el-form-item>
            <el-select
              v-model="submit_data.order_type_key"
              class="order-type-input"
              :disabled="true"
            >
              <el-option
                v-for="item in render_data.order_type_rows"
                :key="item.ddbm"
                :label="item.orderTypeName"
                :value="item.ddbm"
              />
            </el-select>
          </el-form-item>
        </el-form>
      </section>
      <invoice-info
        :receive-invoice.sync="submit_data.invoice_info.receive_invoice"
        :financial-entry.sync="submit_data.invoice_info.financial_entry"
      >
        2、发票信息
      </invoice-info>
      <address-func
        more-btn-text="更多用户"
        :address-id.sync="address_id"
        :is-edit="status.isEdit"
        info-type="less"
        @change-address="getSeledAddress"
      >
        <template #title>
          3、申请退货人信息
        </template>
        <template #btn-name>
          新增退货人
        </template>
      </address-func>
      <!-- <header>
        <h2 class="required">
          4、请下载退货协议，盖章寄回（公章/合同章）
        </h2>
        <el-divider direction="vertical" />
        <el-link type="primary">
          退货协议下载
        </el-link>
      </header> -->
    </article>
    <el-dialog
      title="提交退货单"
      :visible.sync="status.dialogVisible"
      width="30%"
    >
      <span>确认是否提交退货单？</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="status.dialogVisible = false">取 消</el-button>
        <el-button
          type="primary"
          :disabled="status.submit_loading"
          :loading="status.submit_loading"
          @click="onSubmit"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
<script src="./index.js"></script>
<style lang="less" src="./index.less"></style>
